package com.lizhi.yun.core.heart.controller;

import com.lizhi.yun.base.BaseHandler;
import com.lizhi.yun.core.heart.handler.UppHeartHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: lizhi
 * @Description:
 * @Date: create in 2020/7/7 8:37
 */
@Slf4j
@RestController
@RequestMapping(value = "/api/upp/rpc/heart")
public class UppHeartController extends BaseHandler {

    @Resource
    private UppHeartHandler uppHeartHandler;

    @PostMapping(path = "/service")
    public String heartBeat(@RequestBody String json){
        return uppHeartHandler.heartBeat(json);
    }

    @PostMapping(path = "/newService")
    public String newHeartBeat(@RequestBody String json){
        return uppHeartHandler.heartBeat(json);
    }

    @PostMapping(path = "/activeMQConfig")
    public String activeMQConfig(@RequestBody String organId){
        return uppHeartHandler.activeMQConfig(organId);
    }
}
